package com.sl.plugin.step.selenium.click;

import com.sl.core.engine.meta.impl.AbstractProcessCompDescriptor;
import com.sl.core.engine.step.ProcessCompService;
import com.sl.core.engine.step.impl.AbstractProcessComp;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

/**
 */
public class SeleniumClickComp extends AbstractProcessComp<WebDriver, WebDriver> implements ProcessCompService {

    public SeleniumClickComp(AbstractProcessCompDescriptor abstractProcessCompDescriptor) {
        super(abstractProcessCompDescriptor);
    }


    @Override
    public WebDriver input(WebDriver driver) {

        String cssSelector = meta.getStrAttr("cssSelector");

        driver.findElement(By.cssSelector(cssSelector)).click();

        return driver;
    }

}
